// pages/goods/goods.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goods:[]
  },
  getGoods(id){
    wx.request({
      url: 'http://localhost:3000/api/getgoods?fid='+id,
      success: res => {
        this.setData({
          goods: res.data.list
          
        })
      }
    })
  },
  buyNow(evt){
    console.log("goods:",evt);
    let id = evt.currentTarget.dataset.id
    wx.navigateTo({
      url: '/pages/detail/detail?id='+id,
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    let id = options.fid;
    this.getGoods(id)
  },

})